<template>
	<view class="mainbgc ">
		<view class="mainpadding2">
			<view class="mainpadding ffffff margin_top4 radius box" v-for="item in list" :key="item.id" @click="tiao(item)">
				<view class="flexleft">
					<view class="circle"></view>
					<view class="">{{item.name}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				category_id: "",
				list: [],
				type: 1
			}
		},
		onLoad(options) {
			this.category_id = options.id
			this.type = options.type
			uni.setNavigationBarTitle({
				title:options.name
			})
			this.init()
		},
		methods: {
			init() {
				let _this = this;
				httpRequest.request('/api/quizz_chapter/lists', 'POST', {
					category_id: this.category_id
				}).then(res => {
					if (res.code == 1) {
						this.list = res.data
					} else {
						httpRequest.toast(res.msg);
					}
				})
			},
			tiao(item) {
				uni.navigateTo({
					url: "/pages/homepage/xuanzeti?chapter_id=" + item.id + "&type=" + this.type + "&name=" + item.name
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.line {
		border-bottom: 1rpx solid RGBA(236, 236, 236, 1);
		padding-bottom: 40rpx;
	}

	.circle {
		width: 22rpx;
		height: 22rpx;
		background: #DCB490;
		opacity: 1;
		border: 1rpx solid #000000;
		border-radius: 50%;
		margin-right: 21rpx;
	}

	.section {
		font-size: 30rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #000000;
	}

	.box {
		box-shadow: 0rpx 0rpx 15rpx 0rpx rgba(51, 51, 51, 0.0500);
	}

	.mainbgc {
		overflow: hidden;
	}

	.dou {
		width: 9rpx;
		height: 9rpx;
		background: #666666;
		opacity: 1;
		border-radius: 50%;
		margin-right: 24rpx;
	}
</style>